<template>
  <div class="header-box">
    <el-icon @click.stop="Logout"><Expand /></el-icon>
  </div>
</template>

<script setup lang="ts">
import router from '@/router'
import { ElMessageBox } from 'element-plus'
const Logout = () => {
  ElMessageBox.confirm('是否确定退出登录？', '退出登录', {
    confirmButtonText: '退出',
    cancelButtonText: '取消',
    icon: 'QuestionFilled',
    customClass: 'header-message'
  })
    .then(() => {
      router.replace({ name: 'Login' })
    })
    .catch(() => {})
}
</script>

<style scoped lang="scss">
.header-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;

  .el-icon {
    font-size: 22px;
    margin-left: auto;
    cursor: pointer;
    color: #909399;
    &:hover {
      color: #5f6265;
    }
  }

  .header-message {
    .el-message-box__content .el-message-box__container .el-icon {
      font-size: 30px;
    }
  }
}
</style>

<style lang="scss">
.header-message .el-message-box__content .el-message-box__container {
  .el-message-box__status {
    font-size: 20px;
    color: #e6a23c;
  }
  .el-message-box__message p {
    line-height: 30px;
  }
}
</style>
